// Copyright (c) Appeon. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. 
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Threading;
using System.Threading.Tasks;

namespace SnapObjects.Data
{
    public interface IAdoDbResultSet<TModel> :
        IEnumerable<TModel>,
        IEnumerator<TModel>,
        IListSource,
        IDisposable,
        IAsyncEnumerable<TModel>,
        IAsyncEnumerator<TModel>,
        IAsyncDisposable
    {
        IList<DbColumnInfo> GetColumnSchema();

        IList<TModel> GetList(int currentIndex, int size);

        Task<IList<TModel>> GetListAsync(
            int currentIndex, int size, CancellationToken cancellationToken = default);

        IModelFactory<TModel> ModelFactory { get; }
        
        IModelAccessor<TModel> ModelAccessor { get; }

        ValueTask<bool> MoveNextAsync(CancellationToken cancellationToken);
    }
}
